package com.beta.em.pay;

import org.apache.commons.lang3.StringUtils;

import java.util.Arrays;

/**
 * Created by vector on 2016/11/25.
 */
public enum PayRoutes {

    YEEPAY("yeepay", "易宝App支付"),
    WEPAY("wepay", "微信App支付"),
    ALIPAY("alipay", "支付宝App支付")
    ;

    private final String value;
    private final String desc;

    PayRoutes(String value, String desc) {
        this.value = value;
        this.desc = desc;
    }

    public static PayRoutes getPayRoutes(String value) {
        return Arrays.stream(values()).filter(payType -> StringUtils.equals(payType.value(), value)).findFirst().orElse(null);
    }

    public String value() {
        return value;
    }

    public String desc() {
        return desc;
    }

}
